﻿using FB.Data.Models;
using FB.Enums;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;

namespace FB.Providers.EmployeeInfo
{
    [Table("emp_Positions")]
    public class Position : FBAuditModel, IOrder, IRecordState, IEmployeeInfoEntity
    {
        [Key, StringLength(8)]
        [Display(ResourceType = typeof(Resources.Models.Position), Name = "POSCode")]
        public string POSCode { get; set; }

        [Required, StringLength(256)]
        [Display(ResourceType = typeof(Resources.Models.Position), Name = "Name")]
        public string Name { get; set; }

        [Required]
        [Display(ResourceType = typeof(Resources.Models.Position), Name = "Grading")]
        public decimal Grading { get; set; }

        [StringLength(8)]
        public string ParentPOSCode { get; set; }

        [EnumDataType(typeof(RecordState))]
        [Display(ResourceType = typeof(Resources.Models.Position), Name = "RecordState")]
        public RecordState RecordState { get; set; }

        [Display(ResourceType = typeof(Resources.Models.Position), Name = "Order")]
        public int? Order { get; set; }

        [ForeignKey("ParentPOSCode")]
        public virtual Position ParentPosition { get; set; }

    }
}
